const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
// const axisProps = require('../tw-lib-base/chart/axis-props')
// const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  // ...axisProps,
  // ...datazoomProps,
  ...tooltipProps,

  showAxis: {
    type: Boolean,
    default: false,
    name: '显示坐标轴',
    filedType: 'switch'
  },

  data: {
    type: Array,
    default () {
      return [
        {
          name: '张思锐',
          value: 50
        }
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },
  height: {
    type: String,
    default: '300px',
    name: '图表容器高度',
    filedType: 'string'
  },

  triggerType: {
    type: String,
    default: 'item',
    name: '触发类型',
    filedType: 'select',
    options: [
      {
        name: 'axis',
        value: 'axis'
      },
      {
        name: 'item',
        value: 'item'
      }
    ],
    // 是否支持多选，支持多选时default要指定为数组
    multiple: false
  },
  useTooltipFun: {
    type: Boolean,
    default: true,
    name: '启用tooltip函数',
    filedType: 'switch'
  },
  funcTooltip: {
    type: String,
    default: 'window.tmptooltipfunc = function (obj) {console.log(obj);let value=obj.value; return " " + obj.seriesName + " " + "</br> 哈哈：" + value[2] + "</br> 呵呵：" + value[3]}',
    name: 'tooltip触发函数',
    filedType: 'function'
  },
  radiusLength: {
    type: String,
    default: '75%',
    name: '图形半径',
    filedType: 'string'
  },
  showAxisLine: {
    type: Boolean,
    default: true,
    name: '显示轴线',
    filedType: 'switch'
  },
  axisLineWidth: {
    type: String,
    default: '20',
    name: '轴线宽度',
    filedType: 'string'
  },
  showAxisLabel: {
    type: Boolean,
    default: false,
    name: '显示轴线标签',
    filedType: 'switch'
  },
  showAxisTick: {
    type: Boolean,
    default: false,
    name: '显示轴线小标记',
    filedType: 'switch'
  },
  showAxisSplitLine: {
    type: Boolean,
    default: false,
    name: '显示分隔线',
    filedType: 'switch'
  },
  showTitle: {
    type: Boolean,
    default: false,
    name: '显示标题',
    filedType: 'switch'
  },

  detailLabel: {
    type: String,
    default: '%',
    name: '数据单位',
    filedType: 'string'
  },
  detailFontSize: {
    type: String,
    default: '40',
    name: '数据字体大小',
    filedType: 'string'
  },
  detailFontFamily: {
    type: String,
    default: 'digiface',
    name: '数据字体',
    filedType: 'string'
  },
  detailColor: {
    type: String,
    default: '#000',
    name: '数据颜色',
    filedType: 'string'
  },

  lineType: {
    type: String,
    default: '0.8:0.1,0.8;1',
    name: '分段',
    filedType: 'string'
  },

  colors: {
    type: Array,
    default () {
      return [
        '#657df5',
        '#ffb336',
        '#4ac7ff',
        '#2bd3bd',
        '#96e388',
        '#fecd63',
        '#1276ff',
        '#03d6ef',
        '#7114ff',
        '#b62ad1',
        '#f83818',
        '#ff9e13',
        '#ffc513',
        '#5bd917',
        '#17d9b2'
      ]
    },
    name: '调色板',
    nameTip: '图表按此处指定的值循环取色',
    filedType: 'list',
    subType: 'color',
    subDefault: '#2bd3bd',
    max: 20
  },

  showPointer: {
    type: Boolean,
    default: true,
    name: '显示指针',
    filedType: 'switch'
  },
  pointerLength: {
    type: String,
    default: '70%',
    name: '指针长度',
    filedType: 'string'
  },
  pointerWidth: {
    type: String,
    default: '8',
    name: '指针宽度',
    filedType: 'string'
  },

  dataTop: {
    type: String,
    default: '70%',
    name: '数据距顶部距离',
    filedType: 'string'
  },
  dataLeft: {
    type: String,
    default: '0',
    name: '数据距左距离',
    filedType: 'string'
  },

  ...nodata
}
